<?php
require_once 'classes/Database.php';
require_once 'classes/OrderManager.php';
require_once 'classes/CDKManager.php';

$orderManager = new OrderManager();
$cdkManager = new CDKManager();

// 检查最新的订单
$order = $orderManager->getOrderByNo('202509290105350605');
echo "订单详情:\n";
print_r($order);

// 检查该商品是否有可用的CDK码
$availableCDK = $cdkManager->getAvailableCDK($order['product_id']);
echo "\n该商品可用CDK码:\n";
print_r($availableCDK);

// 检查该订单是否分配了CDK码
$assignedCDK = $cdkManager->getCDKByOrderId($order['id']);
echo "\n该订单分配的CDK码:\n";
print_r($assignedCDK);
?>
